if (!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups")) {
	jsx3.require("jsx3.gui.Dialog")
/**
*
*/
  jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.userMgt.permissions", function (permissions) {
});

/**
*
*/
  jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups",
        jsx3.gui.Dialog,
        null,
        function (usersNGroups) {

			usersNGroups.prototype.initialize = function() {
				this.tabUsers = this.getDescendantOfName("tabUsers_24_M");
				this.tabGroups = this.getDescendantOfName("tabGroups_24_M");
                var me = this;
                tibco.admin.Main.loadUIResourceAsync(this.tabUsers.getContentPane(),"tibco.admin","tibco/admin/enterpriseAssets/userMgt/window/permissions/ui/userList.xml", me, me.usersBlockLoaded, true);

                this.paraType;
				this.paraName;
				this.paraId;

                //this.subscribeAll();
                //this.callgetPermissions("SRTest","ServiceAssembly",285);
                /*
                if(jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.userMgt.window.Window")) {
                    // set the window instance
                    this.window = this.getAncestorOfType(tibco.admin.enterpriseAssets.userMgt.window.Window)
                    if(this.window) {
                        this.setWindowId(this.window.getId());
                    }
                }
                */
                /*
                * UG_FLAG_U is the userGroupFlag which distinguish the current record.
                * user: means  the current record in the matrix is a user name
                * group: means the current record in the matrix is a group name
                */
                this.UG_FLAG_U = "user";
                this.UG_FLAG_G = "group";

                this.saveName;
                this.saveType;
                this.saveId;
                this.arrayNameAndId;

                // set the matrix
                this.mtxView = this.getDescendantOfName("mtxView_24_M_1");
                this.mtxEdit = this.getDescendantOfName("mtxEdit_24_M_1");
                this.mtxOwner = this.getDescendantOfName("mtxOwner_24_M_1");

                this.btnSave = this.getDescendantOfName("btnSave_24_M_1");

                this.cbAddOrReplace = this.getDescendantOfName("ckBox_24_M_1");

                //var me = this;
                this.mtxView.onDelete = function(rowId) {
                    me.onDelete(me.mtxView, rowId);
                }

                this.mtxEdit.onDelete = function(rowId) {
                    me.onDelete(me.mtxEdit, rowId);
                }

                this.mtxOwner.onDelete = function(rowId) {
                    me.onDelete(me.mtxOwner, rowId);
                }

                this.btnSave.doSave = function() {
                    me.callsetPermissions(me.saveName, me.saveType, me.saveId);
                }

                this.btnSave.doAddPermission = function() {
                    me.generateNameIdInputXML();
                    me.callsetBulkPermissions();
                }

			}

            // set the window instance
            usersNGroups.prototype.setWindow = function(window) {
                this.window = window
                this.setWindowId(this.window.getId());
            }

            usersNGroups.prototype.subscribeAll = function() {
				tibco.admin.PubSub.subscribe("tibco.admin.enterpriseAssets.userMgt.EventID.SET_BULK_PERMISSION_INTERNAL", this, this.setBulkPermissionInternal);
				tibco.admin.PubSub.subscribe("tibco.admin.enterpriseAssets.userMgt.EventID.PERMISSION_WIN_POPUP", this, this.loadMain);
            }

            usersNGroups.prototype.unsubscribeAll = function() {
				tibco.admin.PubSub.unsubscribe("tibco.admin.enterpriseAssets.userMgt.EventID.SET_BULK_PERMISSION_INTERNAL", this);
                tibco.admin.PubSub.unsubscribe("tibco.admin.enterpriseAssets.userMgt.EventID.PERMISSION_WIN_POPUP", this);
            }


//			usersNGroups.prototype.loadSubComponent = function(nodeName, path) {
//                alert("Load sub component called for USersNGroups!!");
//                    var domeNode = this.getDescendantOfName(nodeName);
//                    if (domeNode.getChildren().length == 0) {
//                        tibco.admin.Main.loadUIResourceAsync(domeNode, "tibco.admin", path, this, this.isLoaded, true);
//                    }
//            }

			/**
			 * The call back function of load sub component
			 */
			usersNGroups.prototype.usersBlockLoaded = function(msg) {
                this.addUsersBlock = msg.obj;
                this.mtxMain = this.addUsersBlock.getDescendantOfName("mtxSearchRs_24_M_1");
                this.btnUserSearch = this.addUsersBlock.getDescendantOfName("btnSearch_24_M_1");
                var me = this;
                this.btnUserSearch.callsearchUsers = function() {
                    me.callsearchUsers();
                }
                var parent = this.addUsersBlock.getParent();
                setTimeout(function() {

                    parent.repaint();
                }, 10);

                tibco.admin.Main.loadUIResourceAsync(this.tabGroups.getContentPane(), "tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/ui/groupList.xml",  me, me.groupsBlockLoaded, true);
            }

            usersNGroups.prototype.groupsBlockLoaded = function(msg) {
                this.addGroupsBlock = msg.obj;
                this.mtxGroupMain = this.addGroupsBlock.getDescendantOfName("mtxGroupSearchRs_24_M_1");
                this.btnGroupSearch = this.addGroupsBlock.getDescendantOfName("btnGroupSearch_24_M_1");
                var me = this;
                this.btnGroupSearch.callsearchGroups = function() {
                    me.callsearchGroups();
                }
                this.subscribeAll();
            }

            /**
			 * Switch the user and group matrix
			 * @para strUserGroupFlag {string} "group" or "user"
			 */
			usersNGroups.prototype.loadTab = function(strUserGroupFlag) {
                 if(strUserGroupFlag == "group"){
//                    this.getDescendantOfName("blkUserList_24_M_1").setDisplay(jsx3.gui.Block.DISPLAYNONE,true);
//					this.getDescendantOfName("blkGroupList_24_M_1").setDisplay(jsx3.gui.Block.DISPLAYBLOCK,true);
				 }else{
					if(strUserGroupFlag == "user"){
//						this.getDescendantOfName("blkGroupList_24_M_1").setDisplay(jsx3.gui.Block.DISPLAYNONE,true);
//						this.getDescendantOfName("blkUserList_24_M_1").setDisplay(jsx3.gui.Block.DISPLAYBLOCK,true);
					}
				  }
            }

			/**
			 *   Load set permisstion pupup window
			 *   @para type {string} The node type
			 *   @para name {string} The node name
			 *   @para id {string} The node id
			 */
			usersNGroups.prototype.setPermission = function(type,name,id){
				//this.loadMain(type,name,id);
                var msg = new Object();
                msg.subject = tibco.admin.enterpriseAssets.userMgt.EventID.PERMISSION_WIN_POPUP;
                msg.type = type;
                msg.name = name;
                msg.id = id;
				msg.executeFlag = false;
                //msg.windowId = this.getWindowId()
				if(this.getWindowId())
				{
                    msg.windowId = this.getWindowId();
				}
                tibco.admin.PubSub.publish(msg);
            }

			/**
			 *   Load add permisstion pupup window
			 *   @para type {string} The node type
			 *   @para arrayNameId {Array} The nodes' name and id array
			 */
			usersNGroups.prototype.setBulkPermission = function(type,arrayNameId){
				var msg = new Object()
                msg.type = type;
                msg.arrayNameId = arrayNameId;
                msg.subject = "tibco.admin.enterpriseAssets.userMgt.EventID.SET_BULK_PERMISSION_INTERNAL";
                msg.windowId = this.getWindowId();
				msg.executeFlag = false;
                tibco.admin.PubSub.publish(msg);
            }

			usersNGroups.prototype.setBulkPermissionInternal = function(objEvent) {
				if(objEvent.executeFlag == true){
					return;
				}
				else{
					if (this.getWindowId()) {
						if (objEvent.windowId == this.getWindowId()) {
							this.loadAddMain(objEvent.type, objEvent.arrayNameId);
						}
					}
					else {
						this.loadAddMain(objEvent.type, objEvent.arrayNameId);
					}
				}
				objEvent.executeFlag = true;
            }


            /**
             *   Load the "Set Permisstion" dialog
             *   @para type {string} The type of the node
             *   @para name {string} The node name
             *   @para id {string} The node id
             */
            usersNGroups.prototype.loadMain = function(objEvent) {
				if(objEvent.executeFlag == true){
					return;
				}
				else{
					if (this.getWindowId()) {
						if (objEvent.windowId == this.getWindowId()) {
							this.saveName = objEvent.name;
							this.saveType = objEvent.type;
							this.saveId = objEvent.id;
							this.callgetPermissions(objEvent.name, objEvent.type, objEvent.id);
						}
					}
					else {
						this.saveName = objEvent.name;
						this.saveType = objEvent.type;
						this.saveId = objEvent.id;
						this.callgetPermissions(objEvent.name, objEvent.type, objEvent.id);
					}
					objEvent.executeFlag = true;
				}
                
            }

            /**
             *   set the current window ID
             *   @para strId {string} The window id
             */
            usersNGroups.prototype.setWindowId = function(strId) {
                this.windowId = strId
            }

            /**
             *   get the current window ID
             *   @return {string} The window id
             */
            usersNGroups.prototype.getWindowId = function() {
                return this.windowId
            }

            /**
             *
             */
            usersNGroups.prototype.loadAddMain = function(type, arrayNameId) {
                //this.btnSave.EXECUTE = "this.doAddPermission()";
                this.btnSave.setEvent("this.doAddPermission()", jsx3.gui.Interactive.EXECUTE);
                this.getDescendantOfName("ckBox_24_M_1").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                this.saveType = type;
                this.arrayNameAndId = arrayNameId;
                this.callsearchUsers();
                this.callsearchGroups();
            }

            /**
             *	 delete the current record in group added list and add the delete record into the search result list
             */
            usersNGroups.prototype.onDelete = function(mtx, recordId) {
                var transRecord = mtx.getRecordNode(recordId);
                transRecord.setAttribute("jsxselected", "0");
                mtx.deleteRecord(recordId, true);
                try {
                    this.mtxMain.insertRecordNode(transRecord, "jsxroot", true);
                    mtx.repaint();
                }
                catch (ex) {
                    tibco.admin.Main.logException(ex, "Error in tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups.onDelete");
                }
            }

            /**
             * Get all permission to init the current node permission - webservice call
             */
            usersNGroups.prototype.callgetPermissions = function(strName, strType, intId) {
                var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/getPermissions.xml", "getPermissions", "Get Permissions");

                objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.ongetPermissionsSuccess);
                //objService.subscribe(jsx3.net.Service.ON_ERROR, this,this.ongetPermissionsError);
                //objService.subscribe(jsx3.net.Service.ON_INVALID, this,this.ongetPermissionsInvalid);
                objService.name = strName;
                objService.type = strType;
                objService.id = intId;
                objService.setEndpointURL(tibco.admin.util.ServiceHelper.getPermissionsEndpointURL());
                objService.doCall();
            };

            usersNGroups.prototype.ongetPermissionsSuccess = function(objEvent) {
                var sourceXML = objEvent.target.getInboundDocument();
                this.mtxView.setSourceXML(sourceXML);
                this.mtxEdit.setSourceXML(sourceXML);
                this.mtxOwner.setSourceXML(sourceXML);
                this.mtxView.repaint();
                this.mtxEdit.repaint();
                this.mtxOwner.repaint();
                this.callsearchUsers();
                this.callsearchGroups();
            };

            usersNGroups.prototype.ongetPermissionsError = function(objEvent) {
            };

            usersNGroups.prototype.ongetPermissionsInvalid = function(objEvent) {
            };

            //call this method to begin the service call (eg.service.callsearchUsers();)
            usersNGroups.prototype.callsearchUsers = function() {
                var text = this.getDescendantOfName("txtKeyword_24_M_1");
                if(text.getValue().length == 0)
                {
                    text.setValue("*");
                }
                var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/searchUsers.xml", "searchUsers", "Search Users");
                //subscribe and call
                objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.onsearchUsersSuccess);
                //objService.subscribe(jsx3.net.Service.ON_ERROR, this,this.onsearchUsersError);
                //objService.subscribe(jsx3.net.Service.ON_INVALID, this,this.onsearchUsersInvalid);
				objService.searchLimit = 500;
                objService.setEndpointURL(tibco.admin.util.ServiceHelper.getUserMgtEndpointURL());
                objService.doCall();
            };

            usersNGroups.prototype.onsearchUsersSuccess = function(objEvent) {
                var responseXML = objEvent.target.getInboundDocument();
                this.mtxMain.setSourceXML(responseXML);
                var allUsersRs = this.mtxMain.getXML().selectNodes("//record");
                for(var i = 0; i < allUsersRs.size(); i++) {
                    var curEntity = allUsersRs.get(i);
                    curEntity.setAttribute("userGroupFlag", this.UG_FLAG_U);
                }
                this.delDuplicate(this.mtxView, this.UG_FLAG_U);
                this.delDuplicate(this.mtxEdit, this.UG_FLAG_U);
                this.delDuplicate(this.mtxOwner, this.UG_FLAG_U);
                this.mtxMain.repaint();
            };

            usersNGroups.prototype.onsearchUsersError = function(objEvent) {
            };

            usersNGroups.prototype.onsearchUsersInvalid = function(objEvent) {
            };

            usersNGroups.prototype.callsearchGroups = function() {
                var text = this.getDescendantOfName("txtGroupKeyword_24_M_1");
                if(text.getValue().length == 0)
                {
                    text.setValue("*");
                }
                //var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/user/rules/searchGroups.xml", "searchGroups", "Search Groups");
                var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/searchGroups.xml", "searchGroups", "Search Groups");

                objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.onsearchGroupsSuccess);
                //objService.subscribe(jsx3.net.Service.ON_ERROR, this, this.onsearchGroupsError);
                //objService.subscribe(jsx3.net.Service.ON_INVALID, this, this.onsearchGroupsInvalid);
				objService.searchLimit = 500;
                objService.setEndpointURL(tibco.admin.util.ServiceHelper.getUserMgtEndpointURL());
                objService.doCall();
            };

            usersNGroups.prototype.onsearchGroupsSuccess = function(objEvent) {
                var sourceXML = objEvent.target.getInboundDocument();
                this.mtxGroupMain.setSourceXML(sourceXML);
                var allGroupsRs = this.mtxGroupMain.getXML().selectNodes("//record");
                for(var i = 0; i < allGroupsRs.size(); i++) {
                    var curEntity = allGroupsRs.get(i);
                    curEntity.setAttribute("userGroupFlag", this.UG_FLAG_G);
                }
                this.delDuplicate(this.mtxView, this.UG_FLAG_G);
                this.delDuplicate(this.mtxEdit, this.UG_FLAG_G);
                this.delDuplicate(this.mtxOwner, this.UG_FLAG_G);
                this.mtxGroupMain.repaint();
            };

            usersNGroups.prototype.onsearchGroupsError = function(objEvent) {
                var myStatus = objEvent.target.getRequest().getStatus();
                tibco.admin.util.Log.USERMGT.error("Error, The service call failed. The HTTP Status code is: " + myStatus);
            };

            usersNGroups.prototype.onsearchGroupsInvalid = function(objEvent) {
                tibco.admin.util.Log.USERMGT.error("Invalid, The following message node just failed validation:\n\n" + objEvent.message);
            };

            /**
             *  Delete the record displayed in the View,Edit and owner matrix from the main user/group search matrix
             *  @para mtx {Matrix} the View/Edit/Owner matrix
             *  @para UGFlag {string} "user"/"group"
             */
            usersNGroups.prototype.delDuplicate = function(mtx, UGFlag) {
                var allRecords = mtx.getXML().selectNodes("//record[@userGroupFlag='" + UGFlag + "']");
                var sourceXML;
                if(UGFlag == this.UG_FLAG_U) {
                    sourceXML = this.mtxMain.getXML();
                    for(var i = 0; i < allRecords.size(); i++)
                    {
                        var tempJsxId = allRecords.get(i).getAttribute("jsxid");
                        var delNode = sourceXML.selectNodes("//record[@jsxid='" + tempJsxId + "' and @userGroupFlag='" + UGFlag + "']");
                        if(delNode.size() > 0) {
                            this.mtxMain.getXML().removeChild(delNode.get(0));
                        }
                    }
                }
                else {
                    if(UGFlag == this.UG_FLAG_G) {
                        sourceXML = this.mtxGroupMain.getXML();
                        for(var i = 0; i < allRecords.size(); i++)
                        {
                            var tempJsxId = allRecords.get(i).getAttribute("jsxid");
                            var delNode = sourceXML.selectNodes("//record[@jsxid='" + tempJsxId + "' and @userGroupFlag='" + UGFlag + "']");
                            if(delNode.size() > 0) {
                                this.mtxGroupMain.getXML().removeChild(delNode.get(0));
                            }
                        }
                    }
                }
            }

            /**
             *   generate the input cache file of the setUserPermission service
             */
            usersNGroups.prototype.generateNameIdInputXML = function() {
                var inputNameIdCache = jsx3.xml.CDF.newDocument();
                for(var i = 0; i < this.arrayNameAndId.length; i++)
                {
                    var obj = this.arrayNameAndId[i];
                    var subRecord = inputNameIdCache.createNode(jsx3.xml.Entity.TYPEELEMENT, "record");
                    subRecord.setAttribute("jsxid", obj.id);
                    subRecord.setAttribute("name", obj.name);
                    inputNameIdCache.appendChild(subRecord);
                }

                tibco.admin.Main.getServer().Cache.setDocument("xmlCacheIDName24M1", inputNameIdCache);

            }

            /**
             *   generate the input cache file of the setUserPermission service
             */
            usersNGroups.prototype.generateInputXML = function() {

                var me = this;

                // create two cache file for input
                var inputUserCache = jsx3.xml.CDF.newDocument();
                var inputGroupCache = jsx3.xml.CDF.newDocument();

                //Here is the private function to generate a single matrix to input cache file
                //curMtx:The matrix want to be translate
                //veoFlag:View/Edit/Owner flag
                function innerGen(curMtx, veoFlag) {
                    var tmpList = curMtx.getXML().selectNodes("//record");
                    for(var i = 0; i < tmpList.size(); i++) {
                        var curView = tmpList.get(i);
                        var subRecord;
                        if(curView.getAttribute("userGroupFlag") == me.UG_FLAG_U) {
                            subRecord = inputUserCache.createNode(jsx3.xml.Entity.TYPEELEMENT, "record");
                        }
                        else {
                            if(curView.getAttribute("userGroupFlag") == me.UG_FLAG_G) {
                                subRecord = inputGroupCache.createNode(jsx3.xml.Entity.TYPEELEMENT, "record");
                            }
                        }
                        subRecord.setAttribute("jsxid", curView.getAttribute("jsxid"));
                        if(veoFlag == "view")
                        {
                            subRecord.setAttribute("hasView", "true");
                            subRecord.setAttribute("hasEdit", "false");
                            subRecord.setAttribute("hasOwner", "false");
                        }
                        else
                        {
                            if(veoFlag == "edit")
                            {
                                subRecord.setAttribute("hasView", "false");
                                subRecord.setAttribute("hasEdit", "true");
                                subRecord.setAttribute("hasOwner", "false");
                            }
                            else
                            {
                                if(veoFlag == "owner")
                                {
                                    subRecord.setAttribute("hasView", "false");
                                    subRecord.setAttribute("hasEdit", "false");
                                    subRecord.setAttribute("hasOwner", "true");
                                }
                                else
                                {

                                }
                            }
                        }
                        if(curView.getAttribute("userGroupFlag") == me.UG_FLAG_U) {
                            inputUserCache.appendChild(subRecord);
                        }
                        else {
                            if(curView.getAttribute("userGroupFlag") == me.UG_FLAG_G) {
                                inputGroupCache.appendChild(subRecord);
                            }
                        }

                    }
                }

                innerGen(this.mtxView, "view");
                innerGen(this.mtxEdit, "edit");
                innerGen(this.mtxOwner, "owner");

                tibco.admin.Main.getServer().Cache.setDocument("xmlCacheIDsetUserPermissions24M1", inputUserCache);
                tibco.admin.Main.getServer().Cache.setDocument("xmlCacheIDsetGroupPermissions24M1", inputGroupCache);
            }

            usersNGroups.prototype.callsetPermissions = function(strName, strType, intId) {
                this.generateInputXML();
                var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/setPermissions.xml", "setPermissions", "Set Permissionss");

                //subscribe and call
                objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.onsetPermissionsSuccess);
                //objService.subscribe(jsx3.net.Service.ON_ERROR, this,this.onsetPermissionsError);
                //objService.subscribe(jsx3.net.Service.ON_INVALID, this,this.onsetPermissionsInvalid);
                objService.name = strName;
                objService.type = strType;
                objService.id = intId;
                objService.setEndpointURL(tibco.admin.util.ServiceHelper.getPermissionsEndpointURL());
                objService.doCall();
            };

            usersNGroups.prototype.onsetPermissionsSuccess = function(objEvent) {
                var msg = new Object();
                msg.subject = tibco.admin.enterpriseAssets.userMgt.EventID.SET_PERMISSION_SUCCESS;
                msg.windowId = this.getWindowId()

                tibco.admin.PubSub.publish(msg)
                this.doClose();

            };

            usersNGroups.prototype.onsetPermissionsError = function(objEvent) {
                //var myStatus = objEvent.target.getRequest().getStatus();
                //objEvent.target.getServer().alert("Error", "The service call failed. The HTTP Status code is: " + myStatus);
            };

            usersNGroups.prototype.onsetPermissionsInvalid = function(objEvent) {
                //objEvent.target.getServer().alert("Invalid", "The following message node just failed validation:\n\n" + objEvent.message);
            };

            usersNGroups.prototype.callsetBulkPermissions = function() {
                this.generateInputXML();
                var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/addPermisstions.xml", "setBulkPermissions", "Set Bulk Permissionss");
                //var objService = tibco.admin.Main.loadService("tibco.admin", "tibco/admin/enterpriseAssets/userMgt/window/permissions/rules/setBulkPermissions.xml", "setBulkPermissions", "Set Bulk Permissionss");
                objService.subscribe(jsx3.net.Service.ON_SUCCESS, this, this.onsetBulkPermissionsSuccess);
                objService.subscribe(jsx3.net.Service.ON_ERROR, this, this.onsetBulkPermissionsError);
                objService.subscribe(jsx3.net.Service.ON_INVALID, this, this.onsetBulkPermissionsInvalid);
                if(this.cbAddOrReplace.getChecked() == jsx3.gui.CheckBox.CHECKED) {
                    objService.bulkAction = "replace";
                }
                else {
                    objService.bulkAction = "add";
                }
                objService.entityType = this.saveType;
                objService.setEndpointURL(tibco.admin.util.ServiceHelper.getPermissionsEndpointURL());
                objService.doCall();
            };

            usersNGroups.prototype.onsetBulkPermissionsSuccess = function(objEvent) {
                //var responseXML = objEvent.target.getInboundDocument();
                //objEvent.target.getServer().alert("Success", "The service call was successful.");
                //this.getAncestorOfType("tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups").doClose();
				this.doClose();
            };

            usersNGroups.prototype.onsetBulkPermissionsError = function(objEvent) {
                //var myStatus = objEvent.target.getRequest().getStatus();
                //objEvent.target.getServer().alert("Error", "The service call failed. The HTTP Status code is: " + myStatus);
                //this.getAncestorOfType("tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups").doClose();
				this.doClose();
            };

            usersNGroups.prototype.onsetBulkPermissionsInvalid = function(objEvent) {
                this.getAncestorOfType("tibco.admin.enterpriseAssets.userMgt.permissions.UsersNGroups").doClose();
                //objEvent.target.getServer().alert("Invalid", "The following message node just failed validation:\n\n" + objEvent.message);
            };
        }
		);
}